function pls=genpls(w,dt)
    pls=zeros(gsize,3*gsize-1);
    for i=0:dt:3*gsize-2
        //plo=rpls2();
        plo=zeros(gsize,H);
        plsi=plsir2(plo,w,i);
        pls(:,i+1:i+dt)=plsi(:,1:dt);
    end
endfunction
function [plo2,s]=atos2(plo)
    s=zeros(3*gsize,1);
    for i=2:3*gsize
        s(i)=s(i-1)+plo(s(i-1)+1,i-1);
    end
    plo2=zeros(size(s,1)-1,1);
    for i=2:size(s,1)
        plo2(i-1)=s(i)-s(i-1);
    end
endfunction
function pls=genpls2(w,dt)
    pls=zeros(gsize,3*gsize-1);
    for i=0:dt:3*gsize-2
        //plo=rpls2();
        //plo=zeros(gsize,H);
        plsi=vlir2(w,i);
        pls(:,i+1:i+dt)=plsi(:,1:dt);
    end
endfunction
function [pls,vls]=genpls3(w,dt)
    pls=zeros(gsize,3*gsize-1);
    vls=zeros(gsize,3*gsize);
    for i=0:dt:3*gsize-2
        //plo=rpls2();
        //plo=zeros(gsize,H);
        [plsi,vli]=vlir2(w,i);
        pls(:,i+1:i+dt)=plsi(:,1:dt);
        vls(:,i+1:i+dt)=vli(:,1:dt);
    end
endfunction
